from celery import Celery
import os


# 1.配置celery可能加载到的美多项目的包
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduo_mall.settings.dev")

# 2.创建celery实例
celery_app = Celery('celery_tasks')

# 3.加载celery配置
celery_app.config_from_object('celery_tasks.config')

# 4.自动加载任务
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email'])